package com.dolphin.business.manager.impl;

import com.dolphin.business.common.utils.PagerModel;
import com.dolphin.business.entity.Report;
import com.dolphin.business.manager.AbstractManager;
import com.dolphin.business.manager.ReportManager;

public class ReportManagerImpl extends AbstractManager implements ReportManager {

	@Override
	public void addReport(Report report) {

		getHibernateTemplate().save(report);
	}

	@Override
	public void delReportById(String id) {

		getHibernateTemplate().delete(findReportById(id));
	}

	@Override
	public PagerModel findAllReports() {

		return searchPaginate("select r from Report r");
	}

	@Override
	public Report findReportById(String id) {

		return (Report)getHibernateTemplate().load(Report.class, id);
	}

	@Override
	public void updateReport(Report report) {

		getHibernateTemplate().update(report);
	}

}
